﻿using UnityEngine;

namespace BridgeShips.AI {
    [System.Serializable]
    public class Driving : PointBased {
        [SerializeField]
        private Vector2 m_WaitTime = new Vector2( 8f, 15f );

        private float m_NextMoveTime;
        private bool m_Waiting;
       // private Vector3? m_SuspectedTarget = new Vector3?( Vector3.zero );
        private AIShip m_Ship;

        public override void OnStart( AIShip ship ) {
            m_Priority = 0;
            m_IsInterruptable = true;
            m_RepeatType = ET.ActionRepeatType.Repetitive;


            base.OnStart( ship );

            m_Ship = ship;
        }

        public override bool CanActivate( AIShip ship ) {
            return ship.Settings.Detection.HasTarget();
        }

        public override void Activate( AIShip ship ) {
            //ship.Settings.Movement.MoveTo(m_PointPositions[m_CurrentIndex]);
        }

        public override void OnUpdate( AIShip ship ) {

        }

        public override void OnDeactivation( AIShip ship ) {

        }

        public override bool IsDone( AIShip ship ) {
            return true;
        }
    }
}